package com.learn.ioc.autowire;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @date: 2020/7/10 10:16
 */
public class AutowireTest {

	public static void main(String[] args) {

		AnnotationConfigApplicationContext act = new AnnotationConfigApplicationContext(JavaConfig.class);
		for (String beanName : act.getBeanDefinitionNames()) {
			System.out.println(beanName);
		}

		System.out.println(act.getBean("classRoom", ClassRoom.class).toString());
	}
}
/* Output:
org.springframework.context.annotation.internalConfigurationAnnotationProcessor
org.springframework.context.annotation.internalAutowiredAnnotationProcessor
org.springframework.context.annotation.internalCommonAnnotationProcessor
org.springframework.context.event.internalEventListenerProcessor
org.springframework.context.event.internalEventListenerFactory
javaConfig
classRoom
student
teacherBean
ClassRoom{student=Student{sid=20200710, sname='学生0710', age=18, addr='湖北黄冈'}, teacher=TeacherBean{tid=20100710, tname='陈老师', course='英语'}}
*///~